package com.qf.purchase.service;

import com.github.pagehelper.PageInfo;
import com.qf.purchase.dao.BrandDao;
import com.qf.purchase.po.Brand;
import com.qf.purchase.po.PurchaseOrder;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class BrandServiceImpl implements BrandService{

    @Resource
    private BrandDao brandDao;

    @Override
    public boolean addBrand(Brand brand) {
        boolean f = brandDao.addBrand(brand)>0?true:false;
        return f;
    }

    @Override
    public PageInfo<Brand> getAllBrandByPage(Map params) {
        List<Brand> brandList=brandDao.getAllBrandByPage(params);
        PageInfo<Brand> pageInfo = new PageInfo<Brand>(brandList);
        return pageInfo;
    }

    @Override
    public boolean updateBrand(Brand brand) {
        return brandDao.updateBrand(brand)>0;
    }

    @Override
    public Brand findBrandById(int id) {
        return brandDao.findBrandById(id);
    }
}
